package me.zk;

/**
 * @Author: zhang kai
 * @Date: 2022/06/22
 * @Description:
 */
public class MathDemo {
    public static void main(String[] args) {
        //lambda表达式
        method(-10, number -> Math.abs(number));
        //方法引用
        method(-10, Math::abs);
    }
    //mathable 相当于匿名函数
    private static void method(int number, MathAble mathable) {
        System.out.println(mathable.getAbs(number));
    }
}
@FunctionalInterface
interface MathAble {
    int getAbs(int number);
}
